<?php

namespace Ignus\View\Node\Expression;

use Ignus\View\Node\Expression;
use Ignus\View\Compiler;
use Ignus\View\NodeInterface;

class ExtensionReference extends Expression
{
    public function __construct($name, $lineno, $tag = null)
    {
        parent::__construct(array(), array('name' => $name), $lineno, $tag);
    }

    public function compile(Compiler $compiler)
    {
        $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name')));
    }
}
